#include "os.h"
#include "gd32vf103c_longan_nano.h"

#define DELAY 10

void user_task0(void)
{
	printf("Task 0: Created!\n");
	while (1) {
//		printf("Task 0: Running...\n");
		task_delay(DELAY);
		gd_led_off(LED1);
//		task_yield();
	}
}

void user_task1(void)
{
	printf("Task 1: Created!\n");
	while (1) {
//		printf("Task 1: Running...\n");
		task_delay(DELAY);
		gd_led_on(LED1);
//		task_yield();
	}
}

/* NOTICE: DON'T LOOP INFINITELY IN main() */
void os_main(void)
{
	gd_led_init(LED1);
	task_create(user_task0);
	task_create(user_task1);
}
